package com.ksd.common.core.exception;


import com.ksd.common.core.response.ResponseEnum;
import com.ksd.exception.ApiException;
import lombok.Data;

/**
 * @author 飞哥
 * @date 2021/6/2 10:40
 */
@Data
public class KsdValidationException extends ApiException {

    private Integer code;
    private String msg;


    public KsdValidationException(ResponseEnum resultEnum) {
        super(resultEnum.getMsg());
        this.code = resultEnum.getCode();
        this.msg = resultEnum.getMsg();
    }
    public KsdValidationException(Integer code, String message) {
        super(code,message);
        this.code = code;
        this.msg = message;
    }

    public KsdValidationException(String message) {
        super(message);
        this.code = ResponseEnum.ERROR.getCode();
        this.msg = message;
    }

    public KsdValidationException() {
        super(ResponseEnum.ERROR.getCode(),ResponseEnum.ERROR.getMsg());
        this.code = ResponseEnum.ERROR.getCode();
        this.msg = ResponseEnum.ERROR.getMsg();
    }


}
